package com.googlecode.imule.data;
import java.util.LinkedList;
import java.util.List;


public class Component {
	
	private String type;
	
	private String description;
	
	private String protocol;
	
	private List<Method> methods;

	
	public Component() {
		methods = new LinkedList<Method>();
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getProtocol() {
		return protocol;
	}

	public void setProtocol(String protocol) {
		this.protocol = protocol;
	}

	public List<Method> getMethods() {
		return methods;
	}

	public void setMethods(List<Method> methods) {
		this.methods = methods;
	}
	
	public void addMethod(Method method){
		this.methods.add(method);
	}
	
	@Override
	public String toString() {
		String prettyPrint =  type +": \""+description + "\", " + protocol;
		
		for (Method method : methods) {
			prettyPrint += "\n\t" + methods.get(0).toString();
		}
		
		return prettyPrint;
	}
}
